package day2

object HelloScala {
  def main(args: Array[String]): Unit = {
    println("Hell scala")
    val array = Array(1, 2, 3, 4, 5)
    println(array.map(_*2))

    for(i <- 1 to 9 ; j <- 1  to i ){
      print(j + "*" + i + "=" + (i*j) + "\t")
      if(i == j)
        println()
    }

    /*for(i <- 1 to 9 ; j <- 1  to i  if(i == j) println() ){
      print(j + "*" + i + "=" + (i*j) + "\t")
     /* if(i == j)
        println()*/
    }*/

    println("从小到大输出！！！")
    for (i <- 1 to 10 ) print(i+"\t")
    println

    println("从大到小输出");
    for(i <- 1.to(10).sorted.reverse) print(i+"\t")
    println



  }
}
